const jsonData = require("../../jsondata.js");
const util = require("../../../../utils/util")
const app = getApp();
const envVersion = app.globalData.envVersion;
const resultConfig = {
	stage: '',
	optionShow: false,
	//全身疾病史
	result: [],
	//是否显示预约
	reservationShow: false,
	startReservationDate: util.addDateSeg(new Date().getTime(), "Month", 0, '-'),
	endReservationDate: util.addDateSeg(new Date().getTime(), "Month", 2, '-'),
	//医保类型
	insuranceType: jsonData.insuranceType,
	insuranceTypeIndex: 0,
	//筛查项目
	screenitem: [{
		new_screenitemId: null,
		new_name: '请选择'
	}],
	screenitemIndex: 0,
	//病种
	diseaseArray: jsonData.diseaseArray,
	diseaseIndex: 0,
	//视力选项
	optionList: jsonData.optionList,
	//1裸眼视力右眼、2裸眼视力右眼、3矫正视力右眼、4矫正视力左眼
	selectType: 0,
	//眼视力右眼
	nakedEyeRightText: '请填写',
	nakedEyeRightId: 0,
	//裸眼视力右眼
	nakedEyeLeftText: '请填写',
	nakedEyeLeftId: 0,
	//矫正视力右眼
	correctRightText: '请选择',
	correctRightId: 0,
	//矫正视力左眼
	correctLeftText: '请选择',
	correctLeftId: 0,
	//预约时间
	appointmenttothehospitaldate: '',
	//医院列表
	hospitalList: [],
	hospitalindex: 0, //医院索引
	//科室
	officeArray: [],
	officeIndex: 0,
	itemData: [{ "id": 0, "name": "请选择" }, { "id": 7, "name": "近视手术" }, { "id": 3, "name": "高度近视" }, { "id": 11, "name": "医学验光配镜" }, { "id": 2, "name": "儿童眼病" },
	{ "id": 8, "name": "斜弱视" },
	{ "id": 5, "name": "角膜塑形镜" },
	{ "id": 1, "name": "白内障" },
	{ "id": 9, "name": "眼底病" },
	{ "id": 4, "name": "角膜及眼表" },
	{ "id": 10, "name": "眼整形眼眶病" },
	{ "id": 12, "name": "青光眼" },
	{ "id": 6, "name": "泪道病" },
	{ "id": 14, "name": "角膜移植" },
	{ "id": 15, "name": "青光VIP特需门诊眼" },
	{ "id": 13, "name": "其他" }
	],
	itemindex: 0,
	//潜在客户对象
	leadEntity: {
		ownerid: null,
		description: '',
		new_gender: 1,
		new_inputingtime: '',
		new_patientsource: 3,
		new_datasource: 17,
		lastname: ''
		// new_age:null,
		// address1_name:'',
		// new_citizenid:''
	},

	//筛查结果
	scresultEntity: [],
	//右眼筛查结果  默认未术
	nakedEyeRightRes: {
		new_scid: null,
		new_categoryid: 'LB0007',
		new_itemid: 'XM0014',
		new_contentid: 'NR0160',
		new_result: 'SC0000000094',
		new_doctorid: null,
		ownerid: null
	},
	//左裸眼筛查结果  默认未术
	nakedEyeLeftRes: {
		new_scid: null,
		new_categoryid: 'LB0007',
		new_itemid: 'XM0014',
		new_contentid: 'NR0161',
		new_result: 'SC0000000093',
		new_doctorid: null,
		ownerid: null
	},
	//裸眼视力 右
	nakedEyeRight: {
		new_scid: null,
		new_categoryid: 'LB0007',
		new_itemid: 'XM0014',
		new_contentid: 'NR0023',
		new_result: '',
		new_doctorid: null,
		ownerid: null
	},
	//裸眼视力 左
	nakedEyeLeft: {
		new_scid: null,
		new_categoryid: 'LB0007',
		new_itemid: 'XM0014',
		new_contentid: 'NR0025',
		new_result: '',
		new_doctorid: null,
		ownerid: null
	},
	//矫正视力 右
	correctRight: {
		new_scid: null,
		new_categoryid: 'LB0007',
		new_itemid: 'XM0010',
		new_contentid: 'NR0024',
		new_result: '',
		new_doctorid: null,
		ownerid: null
	},
	//矫正视力 左
	correctLeft: {
		new_scid: null,
		new_categoryid: 'LB0007',
		new_itemid: 'XM0010',
		new_contentid: 'NR0026',
		new_result: '',
		new_doctorid: null,
		ownerid: null
	},
	//正常、异常
	eyeResult: {
		new_scid: null,
		new_categoryid: 'LB0012',
		new_itemid: 'XM0062',
		new_contentid: 'NR0172',
		new_result: 'SC0000000013',
		new_doctorid: null,
		ownerid: null
	},
	//白内障 右
	cataractRight: {
		new_scid: null,
		new_categoryid: 'LB0001',
		new_itemid: 'XM0002',
		new_contentid: 'NR0165',
		new_result: 'SC0000000029',
		new_doctorid: null,
		ownerid: null
	},
	//白内障 左
	cataractLeft: {
		new_scid: null,
		new_categoryid: 'LB0001',
		new_itemid: 'XM0002',
		new_contentid: 'NR0166',
		new_result: 'SC0000000029',
		new_doctorid: null,
		ownerid: null
	},
	//翼状胬肉(右眼)
	pterygiumRight: {
		new_scid: null,
		new_categoryid: 'LB0002',
		new_itemid: 'XM0003',
		new_contentid: 'NR0163',
		new_result: 'SC0000000029',
		new_doctorid: null,
		ownerid: null
	},
	//翼状胬肉(左眼)
	pterygiumLeft: {
		new_scid: null,
		new_categoryid: 'LB0002',
		new_itemid: 'XM0003',
		new_contentid: 'NR0164',
		new_result: 'SC0000000029',
		new_doctorid: null,
		ownerid: null
	},
	//泪道阻塞
	lacrimalObstruction: {
		new_scid: null,
		new_categoryid: 'LB0003',
		new_itemid: 'XM0004',
		new_contentid: 'NR0064',
		new_result: 'SC0000000029',
		new_doctorid: null,
		ownerid: null
	},
	//倒睫
	trichiasis: {
		new_scid: null,
		new_categoryid: 'LB0010',
		new_itemid: 'XM0029',
		new_contentid: 'NR0043',
		new_result: 'SC0000000029',
		new_doctorid: null,
		ownerid: null
	},
	//结膜炎
	conjunctivitis: {
		new_scid: null,
		new_categoryid: 'LB0002',
		new_itemid: 'XM0003',
		new_contentid: 'NR0155',
		new_result: 'SC0000000029',
		new_doctorid: null,
		ownerid: null
	},
	//屈光不正
	ametropia: {
		new_scid: null,
		new_categoryid: 'LB0005',
		new_itemid: 'XM0055',
		new_contentid: 'NR0156',
		new_result: 'SC0000000029',
		new_doctorid: null,
		ownerid: null
	},
	//眼底疾病
	fundusDiseases: {
		new_scid: null,
		new_categoryid: 'LB0010',
		new_itemid: 'XM0029',
		new_contentid: 'NR0157',
		new_result: 'SC0000000029',
		new_doctorid: null,
		ownerid: null
	},
	//其他描述
	descriptions: {
		new_scid: null,
		new_categoryid: 'LB0012',
		new_itemid: 'XM0056',
		new_contentid: 'NR0158',
		new_result: '',
		new_doctorid: null,
		ownerid: null
	},
	//建议
	advise: {
		new_scid: null,
		new_categoryid: 'LB0012',
		new_itemid: 'XM0046',
		new_contentid: 'NR0142',
		new_result: '',
		new_doctorid: null,
		ownerid: null
	},
	//是否预约
	iSreservation: false,
	//预约
	reservation: {
		new_source: 3,
		new_screen: '',
		new_new_screenitem: '',
		new_mobile: '',
		new_gender: 1,
		new_insurancetype: '',
		new_reservationdate: '',
		new_hospital: '',
		new_department: '',
		new_type: 3,
		new_contnt: ''
	},
	//宣教
	propageanda: {
		new_gender: 1,
		new_age: '',
		new_mobile: '',
		new_tel: '',
		new_healthinsuranceplace: '',
		new_isorder: false,
		new_isfollowself: 1,
		new_followdoctor: '',
		new_countteardrop: '',
		new_doctor: '',
		new_screen: '',
		ownerid: ''
	},
	//筛查客户
	sccustomer: {
		new_scid: null,
		new_scstate: 1,
		new_screenteamid: '',
		new_scitemid: '',
		new_scnum: ''
	},
	//筛查结果 全身疾病史
	systemicDiseases: {
		new_scid: null,
		new_categoryid: 'LB0006',
		new_itemid: 'XM0058',
		new_contentid: 'NR0162',
		new_result: '',
		new_doctorid: null,
		ownerid: null
	},
	//扫描身份证信息
	idCardInfo: {},
	//年龄
	age: undefined,
	//用于提交表单后清空页面数据
	value: undefined,
	//手机号码
	phone: undefined,
	//手机号码2
	phone2: undefined,
	//固话
	tel: undefined,
	//固话2
	tel2: undefined,
	//建议
	advisevalue: undefined,
	//默认值为1
	active1: 1,
	//默认为2
	active0: 0,
	//显示提示建议
	adviseshow: false,
	actions: [{
		name: '初期白内障随访'
	},
	{
		name: '注意用眼,如有不适请到院就诊'
	},
	{
		name: '到院治疗'
	},
	{
		name: '到院复查'
	},
	],
	screenitemId: '',
	screentype: '',
	IsShowtip: false,
	samenameqty: '',
	screenId: '',
    envVersion: envVersion

}

//获取白内障结果
const getCataractRes = (index) => {
	var result = "SC0000000029";
	switch (index) {
		case 0:
			result = "SC0000000029"
			break;
		case 1:
			result = "SC0000000100"
			break;
		case 2:
			result = "SC0000000101"
			break;
		default:
			result = "SC0000000029"
			break;
	}
	return result
}
//获取翼状胬肉结果
const getPterygiumRes = (index) => {
	var result = "SC0000000029";
	switch (index) {
		case 0:
			result = "SC0000000029"
			break;
		case 1:
			result = "SC0000000050"
			break;
		case 2:
			result = "SC0000000020"
			break;
		case 3:
			result = "SC0000000116"
			break;
		case 4:
			result = "SC0000000117"
			break;
		default:
			result = "SC0000000029"
			break;
	}
	return result
}
//获取 无 双 左 右
const getRes = (index) => {
	var result = "SC0000000029";
	switch (index) {
		case 0:
			result = "SC0000000029"
			break;
		case 1:
			result = "SC0000000020"
			break;
		case 2:
			result = "SC0000000002"
			break;
		case 3:
			result = "SC0000000001"
			break;
		default:
			result = "SC0000000029"
			break;
	}
	return result
}

module.exports = {
	getCataractRes,
	getPterygiumRes,
	getRes,
	resultConfig,
}
